package com.example.tms.bean;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.UUID;

/**
 * 文件信息
 */
@Table(name = "file_info")
@Entity
public class FileInfo {
    @Id
    private String fileid;
    private String ownerid;
    private String filename;
    private String fileurl;
    private Boolean sfcz;

    @Override
    public String toString() {
        return "FileInfo{" +
                "fileid='" + fileid + '\'' +
                ", ownerid='" + ownerid + '\'' +
                ", filename='" + filename + '\'' +
                ", fileurl='" + fileurl + '\'' +
                ", sfcz=" + sfcz +
                '}';
    }

    public FileInfo() {
    }

    public FileInfo(String fileid, String ownerid, String filename, String fileurl){
        this.ownerid = ownerid;
        this.filename = filename;
        this.fileurl = fileurl;
        this.sfcz = false;

        if(fileid.equals("")){
            this.fileid =  UUID.randomUUID().toString().replaceAll("-","");
        }else {
            this.fileid = fileid;
        }
    }

    public Boolean getSfcz() {
        return sfcz;
    }

    public void setSfcz(Boolean sfcz) {
        this.sfcz = sfcz;
    }

    public String getFileid() {
        return fileid;
    }

    public void setFileid(String fileid) {
        this.fileid = fileid;
    }

    public String getOwnerid() {
        return ownerid;
    }

    public void setOwnerid(String ownerid) {
        this.ownerid = ownerid;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getFileurl() {
        return fileurl;
    }

    public void setFileurl(String fileurl) {
        this.fileurl = fileurl;
    }
}
